/**
 * 17/nov/2011 - fabio.melillo@gmail.com
 */
package org.unisannio.remote;

import android.content.Context;

/**
 * This class creates needed component for the communication p2p
 * 
 *@author Fabio Melillo
 *
 */
public class FactoryRemote {


	/**
	 * This method returns the object through can communicate with others peers in the broadcast mode
	 * 
	 * @param context
	 * @param port : the port you want to open for the connection
	 * @return a RemoteBroadcaster, needed for the broadcast communication
	 */
	public RemoteBroadcaster getRemoteBroadcaster(Context context, int port){
		return new RemoteBroadcaster(context, port);
	}
	
	/**
	 * This method returns the object through can communicate with others peers in the broadcast mode
	 * The port will be random between 2000 and 4000
	 * 
	 * @param context
	 * @return a RemoteBroadcaster, needed for the broadcast communication
	 */
	public RemoteBroadcaster getRemoteBroadcaster(Context context){
		return new RemoteBroadcaster(context);
	}
	
	/**
	 * This method returns the object through can communicate with others peers sending queries
	 * 
	 * @param context
	 * @param port : the port you want to open for the connection
	 * @return a RemoteContentProvider, needed for the communication with
	 * remote Content Providers
	 */
	public RemoteContentProvider getRemoteContentProvider(Context context, int port){
		return new RemoteContentProvider(context, port);
	}
	
	/**
	 * This method returns the object through can communicate with others peers sending queries
	 * The port will be random between 2000 and 4000
	 * 
	 * @param context
	 * @return a RemoteContentProvider, needed for the communication with
	 * remote Content Providers
	 */
	public RemoteContentProvider getRemoteContentProvider(Context context){
		return new RemoteContentProvider(context);
	}
	
	public RemoteActivity getRemoteActivity(Context context){
		return new RemoteActivity(context);
	}

}
